package com.tanhua.server.controller;

import com.tanhua.commons.utils.Constants;
import com.tanhua.model.vo.HuanXinUserVo;
import com.tanhua.server.interceptor.UserHolder;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/huanxin")
public class HuanxinController {

    /**
     * 获取用户在环信的账号和密码
     * 返回值：
     *    HuanXinUserVo
     */
    @GetMapping("/user")
    public ResponseEntity user() {
        HuanXinUserVo vo = new HuanXinUserVo();
        vo.setUsername("hx"+ UserHolder.getUserId());
        vo.setPassword(Constants.INIT_PASSWORD);
        return ResponseEntity.ok(vo);
    }
}
